#! /usr/bin/env python
from random import *
small=['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','x','y','z']
big=['A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','X','Y','Z']
nums=['0','1','2','3','4','5','6','7','8','9']

def genid(c):
    passw=''
    for x in range(0,c):
        ch=randint(1,8)
      #  print ch
        if ch == 1 or ch == 4 or ch == 8:
            passw+=choice(small)
        elif ch == 2 or ch == 5 or ch == 7:
            passw+=choice(big)
        elif ch == 3 or ch == 6:
            passw+=choice(nums)
    return passw

def usetb(tab):
    return str(tab[randint(0,len(tab)-1)])
